package com.ty.day2;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : txy
 * @Create 2023/10/27 15:05
 */
public class Five {
    public static void main(String[] args) {
        int sum = 0, a = 0, j = 0;
        for (int i = 0; i < 78; i++) {
            sum += i;
            if (i % 3 == 0) {
                a += i;
            }
            if (i % 2 == 1) {
                j += i;
            }
        }
        System.out.println("1~77 sum:" + sum + "," +
                "\nThe sum of data from 1 to 77 that is divisible by 3:" + a +
                "\n1 to 77 odd sum: " + j);

    }
}
